import request from '@/utils/request'

export function getDeptsManagerListSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

// 获取完整的员工列表
export function getEmployeesList(params) {
  return request({
    url: '/sys/user',
    method: 'GET',
    params
  })
}

// 新增员工
export const addEmployees = data => {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

// 批量导入员工
export const importEmployees = data => {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

// 保存员工个人信息
export const saveEmployeesInfo = data => {
  return request({
    url: `/employees/${data.id}/personalInfo`,
    method: 'PUT',
    data
  })
}

// 获取员工岗位信息
export const getEmployeesJobInfo = id => {
  return request({
    url: `/employees/${id}/jobs`
  })
}

// 保存员工岗位信息
export const saveEmployeesJobInfo = data => {
  return request({
    url: `/employees/${data.id}/jobs`,
    method: 'PUT',
    data
  })
}
